// npm i vue-router
import Vue from 'vue'
import VueRouter from 'vue-router'
// 注册路由
Vue.use(VueRouter)
// 配置路由
const router = new VueRouter({
    routes: [
        {
            path: '/',
            redirect: '/Main',  // 重定向:重新指向其它path,会改变网址
        },
        {
            path: '/home',  // 嵌套路由
            component: () => import('@/views/Home'),
            children: [
                {
                    path: '/PlaylistHome',  // 嵌套路由
                    component: () => import('@/views/PlaylistHome'),
                    children: [
                        {
                            path: '/Main',  // 嵌套路由
                            component: () => import('@/views/Main'),
                        },
                        {
                            path: '/MusicSonsList',  // 嵌套路由
                            component: () => import('@/views/MusicSonsList'),
                        }
                    ]
                },
                {
                    path: '/SongDetails',  // 嵌套路由
                    component: () => import('@/views/SongDetails'), 
                },
                {
                    path: '/search',  // 嵌套路由
                    component: () => import('@/views/SearchMain.vue'), 
                }
                
            ]
        },
    ],
})
export default router
